package org.dstart.air.sql.struct
{
	public class SQLData extends Object
	{
		private static var SQL_ID:Number	= 0;
		
		private var m_sqlString:String	= "";	//	SQL 语句
		private var m_sqlID:Number		= 0;	//	当前的 SQL ID 编号
		private var m_sqlData:Object	= {};	//	返回的数据内容
		
		public function SQLData(sql:String)
		{
			if(sql.length >= 2)
			{
				SQL_ID ++;
				
				m_sqlString = sql;
				m_sqlID = SQL_ID;
			}
			else
			{
				throw new Error("Please Input SQL String..");
			}			 
		}
		
		
		//	读取当前对象的编号
		public function get id():Number
		{
			return this.m_sqlID;
		}
		
		//	读取传入的 SQL 语句
		public function get sql():String
		{
			return this.m_sqlString;
		}
		
		//	设置返回的数据内容
		public function set data(obj:Object):void
		{
			this.m_sqlData = obj;
		}
		
		//	读取返回的数据内容
		public function get data():Object
		{
			return this.m_sqlData;
		}		
	}
}